package com.teamblueplus;

	import java.io.File;
	import java.io.FileNotFoundException;
	import java.io.FileOutputStream;

	import android.app.Activity;
	import android.graphics.Bitmap;
	import android.graphics.Bitmap.CompressFormat;
	import android.os.Bundle;
	import android.os.Environment;
	import android.widget.LinearLayout;
	import android.widget.TextView;

	    public class SaveFileTest extends Activity {
	        /** Called when the activity is first created. */
	     LinearLayout ll = null;
	     TextView tv = null;
	        @Override
	        public void onCreate(Bundle savedInstanceState) {
	            super.onCreate(savedInstanceState);
	            setContentView(R.layout.savefile);
	            tv = (TextView) findViewById(R.id.text);
	            ll = (LinearLayout) findViewById(R.id.layout);
	            ll.setDrawingCacheEnabled(true);
	            Bitmap b = ll.getDrawingCache();
	            File sdCard = Environment.getExternalStorageDirectory();
	            File file = new File(sdCard, "image.jpg");
	            FileOutputStream fos;
	      try {
	       fos = new FileOutputStream(file);
	        b.compress(CompressFormat.JPEG, 95,fos);
	      } catch (FileNotFoundException e) {
	       // TODO Auto-generated catch block
	       e.printStackTrace();
	      }

	        }
}
